//
// StreamParameters.hpp for StreamParameters in /home/mambou_j//babel-2014
// 
// Made by jacquesquentin mamboumouafo
// Login   <mambou_j@epitech.net>
// 
// Started on  Mon May 14 18:58:40 2012 jacquesquentin mamboumouafo
// Last update Mon May 14 19:31:18 2012 jacquesquentin mamboumouafo
//


#ifndef	__STREAMPARAMETERS_HPP__
#define	__STREAMPARAMETERS_HPP__

#include	"portaudio.h"
#include	"DirectionSpecificStreamParameters.hpp"

// Declaration(s):
namespace	portaudio
{

	class	StreamParameters
	{
	public:
	  StreamParameters();
	  StreamParameters(const DirectionSpecificStreamParameters &inputParameters, const DirectionSpecificStreamParameters &outputParameters, double sampleRate, unsigned long framesPerBuffer, PaStreamFlags flags);

	  // set up for direction-specific:
	  void	setInputParameters(const DirectionSpecificStreamParameters &parameters);
	  void	setOutputParameters(const DirectionSpecificStreamParameters &parameters);

	  // set up for common parameters:
	  void	setSampleRate(double sampleRate);
	  void	setFramesPerBuffer(unsigned long framesPerBuffer);
	  void	setFlag(PaStreamFlags flag);
	  void	unsetFlag(PaStreamFlags flag);
	  void	clearFlags();

	  // Validation:
	  bool	isSupported() const;

	  // Accessors (direction-specific):
	  DirectionSpecificStreamParameters &inputParameters();
	  const	DirectionSpecificStreamParameters &inputParameters() const;
	  DirectionSpecificStreamParameters	&outputParameters() const;
	  const	DirectionSpecificStreamParameters &outputParameters() const;

	  // Accessors (common):
	  double	sampleRate() const;
	  unsigned	long framesPerBuffer() const;
	  PaStreamFlags	flags() const;
	  bool	isFlagSet(PaStreamFlags flag) const;

	private:
	  // Half-duplex specific parameters:
	  DirectionSpecificStreamParameters	inputParameters_;
	  DirectionSpecificStreamParameters	outputParameters_;

	  // Common parameters:
	  double	sampleRate_;
	  unsigned	long framesPerBuffer_;
	  PaStreamFlags flags_;
	};
}

#endif
